package world.criver.h50529.function;

import javafx.stage.Stage;
import world.criver.h50529.data.daData;

public class funStageMove {
    private double top,left,old_x=-1,old_y=-1;
    public void onPress(double x, double y, Stage stage){
        this.old_x=x;
        this.old_y=y;
        this.top= stage.getY();
        this.left=stage.getX();
    }
    public void onRelease(){
        old_y=-1;
        old_x=-1;
    }
    public void onDrag(double x,double y,Stage stage){
        if(old_y<0 || old_x<0)return;
        stage.setX(left+(x-old_x));
        stage.setY(top+(y-old_y));
    }
}
